home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / QD3DErrors.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  11.3 KB  |  337 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        QD3DErrors.h
  3.  
  4.      Contains:    Error API and error codes                                        
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.6
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1995-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QD3DERRORS__
  18. #define __QD3DERRORS__
  19.  
  20. #ifndef __QD3D__
  21.     #include <QD3D.h>
  22. #endif
  23.  
  24.  
  25. #if TARGET_OS_MAC
  26. #ifndef __MACTYPES__
  27.     #include <MacTypes.h>
  28. #endif
  29.  
  30. #endif  /* TARGET_OS_MAC */
  31.  
  32.  
  33.  
  34. #if PRAGMA_ONCE
  35. #pragma once
  36. #endif
  37.  
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41.  
  42. #if PRAGMA_IMPORT
  43. #pragma import on
  44. #endif
  45.  
  46. #if PRAGMA_STRUCT_ALIGN
  47.     #pragma options align=power
  48. #elif PRAGMA_STRUCT_PACKPUSH
  49.     #pragma pack(push, 2)
  50. #elif PRAGMA_STRUCT_PACK
  51.     #pragma pack(2)
  52. #endif
  53.  
  54. #if PRAGMA_ENUM_ALWAYSINT
  55.     #pragma enumsalwaysint on
  56. #elif PRAGMA_ENUM_OPTIONS
  57.     #pragma option enum=int
  58. #elif PRAGMA_ENUM_PACK
  59.     #if __option(pack_enums)
  60.         #define PRAGMA_ENUM_PACK__QD3DERRORS__
  61.     #endif
  62.     #pragma options(!pack_enums)
  63. #endif
  64.  
  65. /******************************************************************************
  66.  **                                                                             **
  67.  **                            Error Types and Codes                             **
  68.  **                                                                             **
  69.  *****************************************************************************/
  70.  
  71. enum TQ3Error {
  72.     kQ3ErrorNone                = 0,                            /* Fatal Errors */
  73.     kQ3ErrorInternalError        = -28500,
  74.     kQ3ErrorNoRecovery            = -28499,
  75.     kQ3ErrorLastFatalError        = -28498,                        /* System Errors */
  76.     kQ3ErrorNotInitialized        = -28490,
  77.     kQ3ErrorAlreadyInitialized    = -28489,
  78.     kQ3ErrorUnimplemented        = -28488,
  79.     kQ3ErrorRegistrationFailed    = -28487,                        /* OS Errors */
  80.     kQ3ErrorUnixError            = -28486,
  81.     kQ3ErrorMacintoshError        = -28485,
  82.     kQ3ErrorX11Error            = -28484,                        /* Memory Errors */
  83.     kQ3ErrorMemoryLeak            = -28483,
  84.     kQ3ErrorOutOfMemory            = -28482,                        /* Parameter errors */
  85.     kQ3ErrorNULLParameter        = -28481,
  86.     kQ3ErrorParameterOutOfRange    = -28480,
  87.     kQ3ErrorInvalidParameter    = -28479,
  88.     kQ3ErrorInvalidData            = -28478,
  89.     kQ3ErrorAcceleratorAlreadySet = -28477,
  90.     kQ3ErrorVector3DNotUnitLength = -28476,
  91.     kQ3ErrorVector3DZeroLength    = -28475,                        /* Object Errors */
  92.     kQ3ErrorInvalidObject        = -28474,
  93.     kQ3ErrorInvalidObjectClass    = -28473,
  94.     kQ3ErrorInvalidObjectType    = -28472,
  95.     kQ3ErrorInvalidObjectName    = -28471,
  96.     kQ3ErrorObjectClassInUse    = -28470,
  97.     kQ3ErrorAccessRestricted    = -28469,
  98.     kQ3ErrorMetaHandlerRequired    = -28468,
  99.     kQ3ErrorNeedRequiredMethods    = -28467,
  100.     kQ3ErrorNoSubClassType        = -28466,
  101.     kQ3ErrorUnknownElementType    = -28465,
  102.     kQ3ErrorNotSupported        = -28464,                        /* Extension Errors */
  103.     kQ3ErrorNoExtensionsFolder    = -28463,
  104.     kQ3ErrorExtensionError        = -28462,
  105.     kQ3ErrorPrivateExtensionError = -28461,                        /* Geometry Errors */
  106.     kQ3ErrorDegenerateGeometry    = -28460,
  107.     kQ3ErrorGeometryInsufficientNumberOfPoints = -28459,        /* IO Errors */
  108.     kQ3ErrorNoStorageSetForFile    = -28458,
  109.     kQ3ErrorEndOfFile            = -28457,
  110.     kQ3ErrorFileCancelled        = -28456,
  111.     kQ3ErrorInvalidMetafile        = -28455,
  112.     kQ3ErrorInvalidMetafilePrimitive = -28454,
  113.     kQ3ErrorInvalidMetafileLabel = -28453,
  114.     kQ3ErrorInvalidMetafileObject = -28452,
  115.     kQ3ErrorInvalidMetafileSubObject = -28451,
  116.     kQ3ErrorInvalidSubObjectForObject = -28450,
  117.     kQ3ErrorUnresolvableReference = -28449,
  118.     kQ3ErrorUnknownObject        = -28448,
  119.     kQ3ErrorStorageInUse        = -28447,
  120.     kQ3ErrorStorageAlreadyOpen    = -28446,
  121.     kQ3ErrorStorageNotOpen        = -28445,
  122.     kQ3ErrorStorageIsOpen        = -28444,
  123.     kQ3ErrorFileAlreadyOpen        = -28443,
  124.     kQ3ErrorFileNotOpen            = -28442,
  125.     kQ3ErrorFileIsOpen            = -28441,
  126.     kQ3ErrorBeginWriteAlreadyCalled = -28440,
  127.     kQ3ErrorBeginWriteNotCalled    = -28439,
  128.     kQ3ErrorEndWriteNotCalled    = -28438,
  129.     kQ3ErrorReadStateInactive    = -28437,
  130.     kQ3ErrorStateUnavailable    = -28436,
  131.     kQ3ErrorWriteStateInactive    = -28435,
  132.     kQ3ErrorSizeNotLongAligned    = -28434,
  133.     kQ3ErrorFileModeRestriction    = -28433,
  134.     kQ3ErrorInvalidHexString    = -28432,
  135.     kQ3ErrorWroteMoreThanSize    = -28431,
  136.     kQ3ErrorWroteLessThanSize    = -28430,
  137.     kQ3ErrorReadLessThanSize    = -28429,
  138.     kQ3ErrorReadMoreThanSize    = -28428,
  139.     kQ3ErrorNoBeginGroup        = -28427,
  140.     kQ3ErrorSizeMismatch        = -28426,
  141.     kQ3ErrorStringExceedsMaximumLength = -28425,
  142.     kQ3ErrorValueExceedsMaximumSize = -28424,
  143.     kQ3ErrorNonUniqueLabel        = -28423,
  144.     kQ3ErrorEndOfContainer        = -28422,
  145.     kQ3ErrorUnmatchedEndGroup    = -28421,
  146.     kQ3ErrorFileVersionExists    = -28420,                        /* View errors */
  147.     kQ3ErrorViewNotStarted        = -28419,
  148.     kQ3ErrorViewIsStarted        = -28418,
  149.     kQ3ErrorRendererNotSet        = -28417,
  150.     kQ3ErrorRenderingIsActive    = -28416,
  151.     kQ3ErrorImmediateModeUnderflow = -28415,
  152.     kQ3ErrorDisplayNotSet        = -28414,
  153.     kQ3ErrorCameraNotSet        = -28413,
  154.     kQ3ErrorDrawContextNotSet    = -28412,
  155.     kQ3ErrorNonInvertibleMatrix    = -28411,
  156.     kQ3ErrorRenderingNotStarted    = -28410,
  157.     kQ3ErrorPickingNotStarted    = -28409,
  158.     kQ3ErrorBoundsNotStarted    = -28408,
  159.     kQ3ErrorDataNotAvailable    = -28407,
  160.     kQ3ErrorNothingToPop        = -28406,                        /* Renderer Errors */
  161.     kQ3ErrorUnknownStudioType    = -28405,
  162.     kQ3ErrorAlreadyRendering    = -28404,
  163.     kQ3ErrorStartGroupRange        = -28403,
  164.     kQ3ErrorUnsupportedGeometryType = -28402,
  165.     kQ3ErrorInvalidGeometryType    = -28401,
  166.     kQ3ErrorUnsupportedFunctionality = -28400,                    /* Group Errors */
  167.     kQ3ErrorInvalidPositionForGroup = -28399,
  168.     kQ3ErrorInvalidObjectForGroup = -28398,
  169.     kQ3ErrorInvalidObjectForPosition = -28397,                    /* Transform Errors */
  170.     kQ3ErrorScaleOfZero            = -28396,                        /* String Errors */
  171.     kQ3ErrorBadStringType        = -28395,                        /* Attribute Errors */
  172.     kQ3ErrorAttributeNotContained = -28394,
  173.     kQ3ErrorAttributeInvalidType = -28393,                        /* Camera Errors */
  174.     kQ3ErrorInvalidCameraValues    = -28392,                        /* DrawContext Errors */
  175.     kQ3ErrorBadDrawContextType    = -28391,
  176.     kQ3ErrorBadDrawContextFlag    = -28390,
  177.     kQ3ErrorBadDrawContext        = -28389,
  178.     kQ3ErrorUnsupportedPixelDepth = -28388,                        /* Controller Errors */
  179.     kQ3ErrorController            = -28387,                        /* Tracker Errors */
  180.     kQ3ErrorTracker                = -28386,                        /* Another OS Error */
  181.     kQ3ErrorWin32Error            = -28385,                        /* Object Errors */
  182.     kQ3ErrorTypeAlreadyExistsAndHasSubclasses = -28384,
  183.     kQ3ErrorTypeAlreadyExistsAndOtherClassesDependOnIt = -28383,
  184.     kQ3ErrorTypeAlreadyExistsAndHasObjectInstances = -28382,    /* submit loop errors: if you ever get one of these check the previous*/
  185.                                                                 /* error posted, it may be kQ3ErrorOutOfMemory.  If so you *may* be able*/
  186.                                                                 /* to recover by freeing up some memory and trying again*/
  187.     kQ3ErrorPickingLoopFailed    = -28381,
  188.     kQ3ErrorRenderingLoopFailed    = -28380,
  189.     kQ3ErrorWritingLoopFailed    = -28379,
  190.     kQ3ErrorBoundingLoopFailed    = -28378
  191. };
  192. typedef enum TQ3Error TQ3Error;
  193.  
  194.  
  195. enum TQ3Warning {
  196.     kQ3WarningNone                = 0,                            /* General System */
  197.     kQ3WarningInternalException    = -28300,                        /* Object Warnings */
  198.     kQ3WarningNoObjectSupportForDuplicateMethod = -28299,
  199.     kQ3WarningNoObjectSupportForDrawMethod = -28298,
  200.     kQ3WarningNoObjectSupportForWriteMethod = -28297,
  201.     kQ3WarningNoObjectSupportForReadMethod = -28296,
  202.     kQ3WarningUnknownElementType = -28295,
  203.     kQ3WarningTypeAndMethodAlreadyDefined = -28294,
  204.     kQ3WarningTypeIsOutOfRange    = -28293,
  205.     kQ3WarningTypeHasNotBeenRegistered = -28292,                /* Parameter Warnings */
  206.     kQ3WarningVector3DNotUnitLength = -28291,                    /* IO Warnings */
  207.     kQ3WarningInvalidSubObjectForObject = -28290,
  208.     kQ3WarningInvalidHexString    = -28289,
  209.     kQ3WarningUnknownObject        = -28288,
  210.     kQ3WarningInvalidMetafileObject = -28287,
  211.     kQ3WarningUnmatchedBeginGroup = -28286,
  212.     kQ3WarningUnmatchedEndGroup    = -28285,
  213.     kQ3WarningInvalidTableOfContents = -28284,
  214.     kQ3WarningUnresolvableReference = -28283,
  215.     kQ3WarningNoAttachMethod    = -28282,
  216.     kQ3WarningInconsistentData    = -28281,
  217.     kQ3WarningReadLessThanSize    = -28280,
  218.     kQ3WarningFilePointerResolutionFailed = -28279,
  219.     kQ3WarningFilePointerRedefined = -28278,
  220.     kQ3WarningStringExceedsMaximumLength = -28277,                /* Memory Warnings */
  221.     kQ3WarningLowMemory            = -28276,
  222.     kQ3WarningPossibleMemoryLeak = -28275,                        /* View Warnings */
  223.     kQ3WarningViewTraversalInProgress = -28274,
  224.     kQ3WarningNonInvertibleMatrix = -28273,                        /* Quaternion Warning */
  225.     kQ3WarningQuaternionEntriesAreZero = -28272,                /* Renderer Warning */
  226.     kQ3WarningFunctionalityNotSupported = -28271,                /* DrawContext Warning */
  227.     kQ3WarningInvalidPaneDimensions = -28270,                    /* Pick Warning */
  228.     kQ3WarningPickParamOutside    = -28269,                        /* Scale Warnings */
  229.     kQ3WarningScaleEntriesAllZero = -28268,
  230.     kQ3WarningScaleContainsNegativeEntries = -28267,            /* Generic Warnings */
  231.     kQ3WarningParameterOutOfRange = -28266,                        /* Extension Warnings */
  232.     kQ3WarningExtensionNotLoading = -28265,                        /* Object Warnings */
  233.     kQ3WarningTypeAlreadyRegistered = -28264,
  234.     kQ3WarningTypeSameVersionAlreadyRegistered = -28263,
  235.     kQ3WarningTypeNewerVersionAlreadyRegistered = -28262,        /* Invalid Group Object */
  236.     kQ3WarningInvalidObjectInGroupMetafile = -28261
  237. };
  238. typedef enum TQ3Warning TQ3Warning;
  239.  
  240.  
  241.  
  242. enum TQ3Notice {
  243.     kQ3NoticeNone                = 0,
  244.     kQ3NoticeDataAlreadyEmpty    = -28100,
  245.     kQ3NoticeMethodNotSupported    = -28099,
  246.     kQ3NoticeObjectAlreadySet    = -28098,
  247.     kQ3NoticeParameterOutOfRange = -28097,
  248.     kQ3NoticeFileAliasWasChanged = -28096,
  249.     kQ3NoticeMeshVertexHasNoComponent = -28095,
  250.     kQ3NoticeMeshInvalidVertexFacePair = -28094,
  251.     kQ3NoticeMeshEdgeVertexDoNotCorrespond = -28093,
  252.     kQ3NoticeMeshEdgeIsNotBoundary = -28092,
  253.     kQ3NoticeDrawContextNotSetUsingInternalDefaults = -28091,
  254.     kQ3NoticeInvalidAttenuationTypeUsingInternalDefaults = -28090,
  255.     kQ3NoticeBrightnessGreaterThanOne = -28089,
  256.     kQ3NoticeScaleContainsZeroEntries = -28088,
  257.     kQ3NoticeSystemAlreadyInitialized = -28087,
  258.     kQ3NoticeViewSyncCalledAgain = -28086,
  259.     kQ3NoticeFileCancelled        = -28085
  260. };
  261. typedef enum TQ3Notice TQ3Notice;
  262.  
  263. typedef CALLBACK_API_C( void , TQ3ErrorMethod )(TQ3Error firstError, TQ3Error lastError, long reference);
  264. typedef CALLBACK_API_C( void , TQ3WarningMethod )(TQ3Warning firstWarning, TQ3Warning lastWarning, long reference);
  265. typedef CALLBACK_API_C( void , TQ3NoticeMethod )(TQ3Notice firstNotice, TQ3Notice lastNotice, long reference);
  266. /******************************************************************************
  267.  **                                                                             **
  268.  **                                Error Routines                                 **
  269.  **                                                                             **
  270.  *****************************************************************************/
  271. EXTERN_API_C( TQ3Status )
  272. Q3Error_Register                (TQ3ErrorMethod         errorPost,
  273.                                  long                     reference);
  274.  
  275. EXTERN_API_C( TQ3Status )
  276. Q3Warning_Register                (TQ3WarningMethod         warningPost,
  277.                                  long                     reference);
  278.  
  279. EXTERN_API_C( TQ3Status )
  280. Q3Notice_Register                (TQ3NoticeMethod         noticePost,
  281.                                  long                     reference);
  282.  
  283. /*
  284.  *  Getting error codes -
  285.  *    Clears error type on next entry into system (except all of these 
  286.  *  error calls), and returns the last error, and optionally the 
  287.  *    first error. The parameter to these "_Get" calls may be NULL.
  288.  */
  289. EXTERN_API_C( TQ3Error )
  290. Q3Error_Get                        (TQ3Error *                firstError);
  291.  
  292. EXTERN_API_C( TQ3Boolean )
  293. Q3Error_IsFatalError            (TQ3Error                 error);
  294.  
  295. EXTERN_API_C( TQ3Warning )
  296. Q3Warning_Get                    (TQ3Warning *            firstWarning);
  297.  
  298. EXTERN_API_C( TQ3Notice )
  299. Q3Notice_Get                    (TQ3Notice *            firstNotice);
  300.  
  301. #if TARGET_OS_MAC
  302. EXTERN_API_C( OSErr )
  303. Q3MacintoshError_Get            (OSErr *                firstMacErr);
  304.  
  305. #endif  /* TARGET_OS_MAC */
  306.  
  307.  
  308.  
  309. #if PRAGMA_ENUM_ALWAYSINT
  310.     #pragma enumsalwaysint reset
  311. #elif PRAGMA_ENUM_OPTIONS
  312.     #pragma option enum=reset
  313. #elif defined(PRAGMA_ENUM_PACK__QD3DERRORS__)
  314.     #pragma options(pack_enums)
  315. #endif
  316.  
  317. #if PRAGMA_STRUCT_ALIGN
  318.     #pragma options align=reset
  319. #elif PRAGMA_STRUCT_PACKPUSH
  320.     #pragma pack(pop)
  321. #elif PRAGMA_STRUCT_PACK
  322.     #pragma pack()
  323. #endif
  324.  
  325. #ifdef PRAGMA_IMPORT_OFF
  326. #pragma import off
  327. #elif PRAGMA_IMPORT
  328. #pragma import reset
  329. #endif
  330.  
  331. #ifdef __cplusplus
  332. }
  333. #endif
  334.  
  335. #endif /* __QD3DERRORS__ */
  336.  
  337.